Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLS Mode is now an enum #154

Merged
merged 1 commit into from
Dec 15, 2023
Merged

TLS Mode is now an enum #154

merged 1 commit into from
Dec 15, 2023

Conversation

ciroque
Copy link
Collaborator

@ciroque ciroque commented Dec 7, 2023

Proposed changes

Closes #143

This PR does no get into whether no-tls mode should be an error condition. It is much simpler. This is just to move the TLS Mode type from string to enum. This vastly improves the consistency and error detection (fat-fingerings or typos in defining the tlsMode value in the config map).

I will create another issue to address the no-tls being an error condition.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • I have updated any relevant documentation (README.md and CHANGELOG.md)

@ciroque ciroque marked this pull request as ready for review December 12, 2023 18:13
@ciroque ciroque requested a review from chrisakker as a code owner December 12, 2023 18:13
Copy link
Collaborator

@4141done 4141done left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change! One thing I'd like to address before merging is the enum lookup. See my comment and let me know if it makes sense.

internal/configuration/tlsmodes.go Outdated Show resolved Hide resolved
internal/configuration/tlsmodes.go Outdated Show resolved Hide resolved
internal/configuration/settings.go Outdated Show resolved Hide resolved
@ciroque ciroque force-pushed the iss-143-no-tls-explicitness branch 3 times, most recently from ad0a1e0 to e5790ee Compare December 15, 2023 03:35
- Improve enum readability
- Improve TLS Mode configuration validation and application
- Better error message
Copy link
Collaborator

@4141done 4141done left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 🐳 👍
I like how this cleans things up internally in terms of handling the allowed values and providing better error messages. I think we still have discussion to do on desired output but this is a good foundational change to wherever we wind up.

@ciroque ciroque merged commit 537b14a into main Dec 15, 2023
3 checks passed
@ciroque ciroque deleted the iss-143-no-tls-explicitness branch December 15, 2023 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no-tls should be an explicitly handled case
2 participants